package com.study.mybatis;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;

import java.io.InputStream;

/**
 * @program: spring
 * @author: jzhou
 * @date: 2022-04-21 21:46
 * @version: 1.0
 * @description: 切面配置类
 **/
@ComponentScan("com.study.mybatis")
@ZhouyuScan("com.study.mybatis.mapper")
public class AppConfig {
    @Bean
    public SqlSessionFactory sqlSessionFactory() throws Exception{
        InputStream is = Resources.getResourceAsStream("");
        SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(is);
        return sqlSessionFactory;
    }
}
